/*
 * Copyright (c) 2010 Google Inc.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package com.google.api.data.gdata.v2.model;

import com.google.api.client.util.Key;

/**
 * An instant messaging address associated with the containing entity.
 * 
 * @since 2.2
 * @author Nicolas Garnier
 */
public class Im {

  public static final String TYPE_HOME = "http://schemas.google.com/g/2005#home";
  public static final String TYPE_WORK = "http://schemas.google.com/g/2005#work";
  public static final String TYPE_NETMEETING = "http://schemas.google.com/g/2005#netmeeting";
  /**
   * An IM address that is neither home nor work. label can be used to indicate
   * the actual type.
   */
  public static final String TYPE_OTHER = "http://schemas.google.com/g/2005#other";

  public static final String PROTOCOL_AIM = "http://schemas.google.com/g/2005#AIM";
  public static final String PROTOCOL_MSN = "http://schemas.google.com/g/2005#MSN";
  public static final String PROTOCOL_YAHOO = "http://schemas.google.com/g/2005#YAHOO";
  public static final String PROTOCOL_SKYPE = "http://schemas.google.com/g/2005#SKYPE";
  public static final String PROTOCOL_QQ = "http://schemas.google.com/g/2005#QQ";
  public static final String PROTOCOL_GOOGLE_TALK = "http://schemas.google.com/g/2005#GOOGLE_TALK";
  public static final String PROTOCOL_ICQ = "http://schemas.google.com/g/2005#ICQ";
  public static final String PROTOCOL_JABBER = "http://schemas.google.com/g/2005#JABBER";

  /** IM address. */
  @Key("@address")
  public String address;

  /**
   * A simple string value used to name this IM address. It allows UIs to
   * display a label such as "Work", "Personal", "Preferred", etc. In the case
   * where the {@link #type} {@link #TYPE_OTHER} is used.
   */
  @Key("@label")
  public String label;

  /**
   * A programmatic value that identifies the type of IM. Possible values are
   * {@link #TYPE_HOME}, {@link #TYPE_NETMEETING}, {@link #TYPE_OTHER} and
   * {@link #TYPE_WORK}.
   */
  @Key("@rel")
  public String type;

  /**
   * Identifies the IM network. The value may be either one of the standard
   * values (shown below) or a URI identifying a proprietary IM network. Likely
   * possible values are {@link #PROTOCOL_AIM}, {@link #PROTOCOL_GOOGLE_TALK},
   * {@link #PROTOCOL_ICQ}, {@link #PROTOCOL_JABBER}, {@link #PROTOCOL_MSN},
   * {@link #PROTOCOL_QQ}, {@link #PROTOCOL_SKYPE} and {@link #PROTOCOL_YAHOO}.
   */
  @Key("@protocol")
  public String protocol;

  /**
   * When multiple IM extensions appear in a contact kind, indicates which is
   * primary. At most one IM may be primary. Default value is {@code False}.
   */
  @Key("@primary")
  public Boolean primary;
}
